<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

// 后台主页
Route::get('/admin/index', 'Admin\IndexController@index');

// 后台管理
// 用户
Route::get('/admin/user/add', 'Admin\UserController@add');
Route::post('/admin/user/insert', 'Admin\UserController@insert');
Route::get('/admin/user/index', 'Admin\UserController@index');
Route::get('/admin/user/edit/{id}', 'Admin\UserController@edit');
Route::post('/admin/user/update', 'Admin\UserController@update');
Route::get('/admin/user/delete/{id}', 'Admin\UserController@delete');
// ajax修改用户名
Route::get('/admin/user/changename', 'Admin\UserController@changeName');
// ajax禁用/启用
Route::get('/admin/user/changestatus', 'Admin\UserController@changeStatus');

// 分类管理
Route::resource('/admin/category', 'Admin\CategoryController');

//商品管理
Route::resource('/admin/shop_goods', 'Admin\Shop_goodsController');

// 后台登录
Route::get('/admin/login', 'Admin\LoginController@login');
Route::post('/admin/login', 'Admin\LoginController@login');
Route::get('/admin/logout', 'Admin\LoginController@logout');
Route::get('/admin/code/{random?}', 'Admin\CodeController@code');

//找回密码
Route::get('/admin/reset/forget', 'Admin\ResetController@forget');
Route::post('/admin/reset/send', 'Admin\ResetController@send');
Route::get('/admin/reset/find/{token}', 'Admin\ResetController@find');
Route::get('/admin/reset/info', 'Admin\ResetController@info');
Route::post('/admin/reset/uppass', 'Admin\ResetController@uppass');






//前台管理
//前台主页
Route::get('/home/index','Home\IndexController@index');
// 搜索
Route::get('/home/index/search', 'Home\IndexController@search');

//前台登陆
Route::get('/home/login','Home\LoginController@login');
Route::post('/home/login', 'Home\LoginController@login');
Route::get('/home/logout', 'Home\LoginController@logout');
Route::get('/home/code/{random?}', 'Home\CodeController@code');

//找回密码
Route::get('/home/reset/home_forget', 'Home\ResetController@forget');
Route::post('/home/reset/send', 'Home\ResetController@send');
Route::get('/home/reset/find/{token}', 'Home\ResetController@find');
Route::get('/home/reset/info', 'Home\ResetController@info');
Route::post('/home/reset/uppass', 'Home\ResetController@uppass');

//前台注册
Route::get('/home/user/add', 'Home\UserController@add');
Route::post('/home/user/insert', 'Home\UserController@insert');
Route::get('/home/code/{random?}', 'Home\CodeController@code');

//商品管理
Route::resource('/home/shop_orders', 'Home\shop_ordersController');

// 购物车
Route::get('/home/shop_cart/index', 'Home\Shop_cartController@index');
Route::get('/home/shop_cart/ajaxcart', 'Home\Shop_cartController@ajaxcart');
Route::get('/home/shop_cart/tocart/{id}', 'Home\Shop_cartController@tocart');
// 购物车结算生成订单
Route::get('/home/orders/account', 'Home\OrdersController@account');



//我的订单页
Route::get('/home/orders/index', 'Home\OrdersController@index');


